package megacli

// MegaCli -PDList -aN|-a0,1,2|-aALL
// physical drive
type PhyDrive struct {
    // 全球唯一名字
    WWN              string
    // 外壳设备ID
    EnclosureID      string
    // 插槽号
    SlotNumber       string
    // 驱动位置信息
    Group            uint16
    Span             uint16
    Arm              uint16
    // 物理盘类型SAS, SATA
    Type             string
    Model            string
    InquiryRaw       string
    // 磁盘大小
    Size             uint64
    // 固件信息
    FirmwareRevision string
    State            string
    // 物理块设备大小
    PhyBlockSize     uint16
    // 逻辑块设备大小
    LogBlockSize     uint16
    // 连接口
    ConnectedPort    string
    // 磁盘读写速度
    DriveSpeed       string // drive speed (assume it negotiated speed)
    LinkSpeed        string // port speed
    // 当前温度
    CurTemp          int16
    // 是否是固态硬盘
    SolidStateDrive  bool
    // 是否有告警
    SMARTAlert       bool
    // 媒体错误计数
    MediaErrorCount  uint16
    // 其它错误计数
    OtherErrorCount  uint16
    // 预测失败计数
    PredictiveFailureCount  uint16
    // 最后一次预测失败计数
    LastPredictiveFailureCount  uint16
    // 设备ID
    DeviceID         uint16
}

// MegaCli -AdpAllInfo -aN|-a0,1,2|-aALL
// adapter info
type ControllerSpec struct {
    Number       int
    Domain       uint32
    Bus          uint32
    Device       uint32
    Function     uint32
    ProductName  string
    Firmware     string
    BIOS         string
    SerialNumber string
    Battery      bool
}

// logical drive info
type LogDriveSpec struct {
    Label       string
    RAIDLv      Level
    Size        uint64
    State       string
    StripSize   uint64
    CachePolicy string
}

// logical drive
type LogDrive struct {
    LogDriveSpec
    GroupID   uint
    TargetID  uint
    PhyDrives []*PhyDrive
}

// controller
type Controller struct {
    ControllerSpec
    LogDrives    []*LogDrive
    logDeriveMap map[uint]*LogDrive
    //PTPhyDrives  []*PhyDrive // Pass-Through, JBOD
    //UnconfDrives []*PhyDrive
}